<%@ page import="com.mapper.OManagementMapper" %>
<%@ page import="com.Imp.OManagementMapperImpl" %>
<%@ page import="com.entity.OManagement" %>
<%@ page import="java.util.List" %>
<%@ page import="com.mapper.CustomerMapper" %>
<%@ page import="com.entity.Customer" %>
<%@ page import="com.Imp.CustomerMapperImpl" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>页面布局</title>
    <!-- 新 Bootstrap5 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/css/bootstrap.min.css">
    <!--  popper.min.js 用于弹窗、提示、下拉菜单 -->
    <script src="https://cdn.staticfile.org/popper.js/2.9.3/umd/popper.min.js"></script>
    <!-- 最新的 Bootstrap5 核心 JavaScript 文件 -->
    <script src="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/js/bootstrap.min.js"></script>

    <link rel="stylesheet" type="text/css" href="./css/main.css">

</head>
<body>
<div class="container-fluid">
    <div class="row">
        <nav class="navbar navbar-expand-lg navbar-dark bg-dark ">
            <div class="container-fluid">
                <a class="navbar-brand" href="#"><img src="./img/caidan.png" height="35" width="35">&nbsp菜单</a>
                <ul class="navbar-nav ms-auto mb-2 mb-lg-0">
                    <%
                        String customerId = (String) session.getAttribute("username");
                        CustomerMapper customerMapper = new CustomerMapperImpl();
                        Customer customer = customerMapper.getCustomerByUserName(customerId);
                    %>
                    <li class="nav-item">
                        <a class="nav-link" href="information_customer.jsp">尊贵的顾客&nbsp<%=customer.getName() %>，您好！  </a>
                    </li>

                    <li class="nav-item">
                        <a class="nav-link" href="login.jsp">退出登录</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">关于我们</a>
                    </li>
                </ul>
            </div>
        </nav>
    </div>

    <div class="row">
        <div class="col-md-2 sidebar">
            <div class="sidebar-menu">
                <ul class="custom-list ">
                    <li class="active"  ><a href="main.jsp" style="background-color: #55aaff"><img src="./img/main.png" height="18" width="18">&nbsp主页</a></li>

                    <li ><a href="storeList.jsp"><img src="./img/shop.png" height="18" width="18">&nbsp店铺</a></li>
                    <li><a href="cart.jsp"><img src="./img/shoppingTrolley.png" height="18" width="18">&nbsp购物车</a></li>
                    <div id="order">
                        <div class="orderlist">
                            <a class="btn" data-bs-toggle="collapse" href="#collapseOne"><img src="./img/order.png" height="18" width="18">&nbsp我的订单</a>
                        </div>
                        <%
//                            String customerId = (String) session.getAttribute("username");
                            OManagementMapper oManagementMapper_0 = new OManagementMapperImpl();
                            List<OManagement> oManagementList_0 = oManagementMapper_0.getOrdersBycustomerId(customerId);
                            int num1 = 0;
                            int num2 = 0;
                            int num3 = 0;
                            for (OManagement oManagement : oManagementList_0) {
                                if (oManagement.getOrderState().equals("待分配")) {
                                    num1 = num1 + 1;
                                } else if (oManagement.getOrderState().equals("配送中")) {
                                    num2 = num2 + 1;
                                } else if (oManagement.getOrderState().equals("已送达")) {
                                    num3 = num3 + 1;
                                }
                            }
                        %>
                        <div id="collapseOne" class="collapseshow" data-bs-parent="#order">
                            <div class="orderlist-body">
                                <a href="waitingOrders.jsp">待配送（<%= num1 %>）</a>
                            </div>
                        </div>
                        <div id="collapseOne" class="collapseshow" data-bs-parent="#order">
                            <div class="orderlist-body">
                                <a href="deliveringOrders.jsp">配送中（<%= num2 %>）</a>
                            </div>
                        </div>
                        <div id="collapseOne" class="collapseshow" data-bs-parent="#order">
                            <div class="orderlist-body">
                                <a href="deliveredOrders.jsp">已完成（<%= num3 %>）</a>
                            </div>
                        </div>
                    </div>

                    <li><a href="information_customer.jsp"><img src="./img/personal.png" height="18" width="18">&nbsp个人信息</a></li>
                    <li></li>
                </ul>
            </div>
        </div>


        <div class="col-md-10 main-content " >
            <div v-for="store in stores" :key="store.id" class="store-info">
                <h2 class="text-center text-info"><img src="img/F3.jpg"></h2>
                <!-- 轮播 -->
                <div id="demo" class="carousel slide" data-bs-ride="carousel">

                    <!-- 指示符 -->
                    <div class="carousel-indicators">
                        <button type="button" data-bs-target="#demo" data-bs-slide-to="0" class="active"></button>
                        <button type="button" data-bs-target="#demo" data-bs-slide-to="1"></button>
                        <button type="button" data-bs-target="#demo" data-bs-slide-to="2"></button>
                    </div>

                    <!-- 轮播图片 -->
                    <div class="carousel-inner">
                        <div class="carousel-item active">
                            <img src="img/T2.jpg" class="d-block" style="width:100%">
                        </div>
                        <div class="carousel-item">
                            <img src="img/T3.jpg" class="d-block" style="width:100%">
                        </div>
                        <div class="carousel-item">
                            <img src="img/T4.jpg" class="d-block" style="width:100%">
                        </div>
                    </div>

                    <!-- 左右切换按钮 -->
                    <button class="carousel-control-prev" type="button" data-bs-target="#demo" data-bs-slide="prev">
                        <span class="carousel-control-prev-icon"></span>
                    </button>
                    <button class="carousel-control-next" type="button" data-bs-target="#demo" data-bs-slide="next">
                        <span class="carousel-control-next-icon"></span>
                    </button>
                </div>

            </div>
        </div>
    </div>
</div>

<footer class="bg-dark text-light text-center py-4">
    <div class="container1">
        <p>&copy; 美团外卖</p>
    </div>
</footer>


</body>
</html>

